﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using JTicket.BLL;

namespace JTicket.UI
{
    public partial class JT_SystemInfo : RoleBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
                Bind();
        } 
        protected void btnModify_Click(object sender, EventArgs e)
        {
            Model.C_CodeNote codenote = new Model.C_CodeNote();
            codenote.CodeVal = "001";
            codenote.CodeNote = this.txttitle.Text;
            codenote.GroupCode = "System";
            BLL.C_CodeNote.Update(codenote);
            codenote.CodeVal = "002";
            codenote.CodeNote = this.txtcopy.Text;
            codenote.GroupCode = "System";
            BLL.C_CodeNote.Update(codenote);

        }
        void Bind()
        {
            List<Model.C_CodeNote> list = BLL.C_CodeNote.GetListAllByGroupCod("System");
            var x = list.First(a => a.CodeVal == "001");
            this.txttitle.Text = x.CodeNote;
            var y = list.First(b => b.CodeVal == "002");
            this.txtcopy.Text = y.CodeNote;
             
        }
    }
}